package org.wns.model.service;

import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;

public class Util {
    /**
     * Create a URLConnection object with proper timeout values and user agent string.
     */
    public static URLConnection createURLConnection(URL url) throws IOException {
        URLConnection conn = url.openConnection();
        conn.setConnectTimeout(10000);
        conn.setReadTimeout(10000);
        conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
        return conn;
    }
}
